package com.x_memteor.base_master.bean.request;

import android.text.TextUtils;

import com.x_memteor.base_master.base.BaseRequestEntity;
import com.x_memteor.base_master.utils.MD5Utils;

/**
 * @author: X_Meteor
 * @description: 类描述
 * @version: V_1.0.0
 * @date: 2018/3/14 0014 上午 10:23
 * @company:
 * @email: lx802315@163.com
 */
public class UpWeightBody extends BaseRequestEntity {

   /* weight体重信息 double
    macid 获取token时返回的macid
    sign 签名*/

    private String macid;
    private String token;
    private String weight;
    private String sign;

    public UpWeightBody(String macid, String token, String weight) {
        this.macid = macid;
        this.token = token;
        this.weight = weight;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getMacid() {

        return macid;
    }

    public void setMacid(String macid) {
        this.macid = macid;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public String getSign() {
        String sign = "";

        StringBuffer sb = new StringBuffer();
        sb.append("macid=");
        sb.append(macid);
        sb.append("&token=");
        sb.append(token);
        sb.append("&weight=");
        sb.append(weight);

        if (!TextUtils.isEmpty(sb)) {
            sign = MD5Utils.encryptMD5(sb.toString());
        }
        return sign;
    }

    @Override
    public String getCiphertext() {
        return null;
    }
}
